@echo Deploying FBAManagement solution

@set PATH=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN;%PATH%

@if "%1"=="" (goto invalidParameters) 

stsadm -o deactivatefeature -name SelfManagement -url %1 -force
stsadm -o deactivatefeature -name AdminManagement -url %1 -force
stsadm -o deactivatefeature -name ConfigManagement -url %1 -force
stsadm -o deactivatefeature -name FormsBasicAuth -url %1 -force

stsadm -o uninstallfeature -name SelfManagement -force
stsadm -o uninstallfeature -name AdminManagement -force
stsadm -o uninstallfeature -name ConfigManagement -force
stsadm -o uninstallfeature -name FormsBasicAuth -force

stsadm -o retractsolution -name FBAManagement.wsp -immediate -url %1
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name FBAManagement.wsp -override

stsadm -o addsolution -filename bin\FBAManagement.wsp
stsadm -o deploysolution -name FBAManagement.wsp -immediate -allowgacdeployment -force -url %1
stsadm -o execadmsvcjobs

stsadm -o installfeature -name SelfManagement -force
stsadm -o installfeature -name AdminManagement -force
stsadm -o installfeature -name ConfigManagement -force
stsadm -o installfeature -name FormsBasicAuth -force

stsadm -o activatefeature -name SelfManagement -url %1
stsadm -o activatefeature -name AdminManagement -url %1
stsadm -o activatefeature -name FormsBasicAuth -url %1


@goto endOfBatch

:invalidParameters
	@echo Please call with the correct parameters.
	@echo The correct syntax of this command is:
	@echo Deploy [siteurl]	

:endOfBatch